<!-- 
    Document   : a
    Created on : Jun 1, 2008, 2:42:37 PM
    Author     : armandoleal
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <div title="imports">
        <!-- Jacob Draw Toolkit -->
        <!-- Common, all times required -->
        <script src="draw2d/wz_jsgraphics.js"></script>
	<script src="draw2d/events.js"></script>
	<script src="draw2d/debug.js"></script>
	<script src="draw2d/dragdrop.js"></script>
	<script src="draw2d/Graphics.js"></script>
	<script src="draw2d/Color.js"></script>
	<script src="draw2d/ArrayList.js"></script>
	<script src="draw2d/Point.js"></script>
	<script src="draw2d/Dimension.js"></script>
	<script src="draw2d/Border.js"></script>
	<script src="draw2d/LineBorder.js"></script>
	<script src="draw2d/Figure.js"></script>
	<script src="draw2d/Node.js"></script>
        <script src="draw2d/VectorFigure.js"></script>
	<script src="draw2d/Label.js"></script>
	<script src="draw2d/Oval.js"></script>
	<script src="draw2d/Circle.js"></script>
	<script src="draw2d/Rectangle.js"></script>
	<script src="draw2d/ImageFigure.js"></script>
	<script src="draw2d/Port.js"></script>
	<script src="draw2d/InputPort.js"></script>
	<script src="draw2d/OutputPort.js"></script>
	<script src="draw2d/Line.js"></script>
	<script src="draw2d/ConnectionRouter.js"></script>
	<script src="draw2d/NullConnectionRouter.js"></script>
	<script src="draw2d/ManhattanConnectionRouter.js"></script>
	<script src="draw2d/BezierConnectionRouter.js"></script>
	<script src="draw2d/FanConnectionRouter.js"></script>
	<script src="draw2d/Connection.js"></script>
	<script src="draw2d/ConnectionAnchor.js"></script>
	<script src="draw2d/ChopboxConnectionAnchor.js"></script>
	<script src="draw2d/CompartmentFigure.js"></script>
	<script src="draw2d/Document.js"></script>
	<script src="draw2d/Annotation.js"></script>
	<script src="draw2d/ResizeHandle.js"></script>
	<script src="draw2d/LineStartResizeHandle.js"></script>
	<script src="draw2d/LineEndResizeHandle.js"></script>
	<script src="draw2d/Canvas.js"></script>
	<script src="draw2d/Workflow.js"></script>
	<script src="draw2d/Window.js"></script>
	<script src="draw2d/Button.js"></script>
	<script src="draw2d/ToggleButton.js"></script>
	<script src="draw2d/SnapToHelper.js"></script>
	<script src="draw2d/SnapToGeometry.js"></script>
	<script src="draw2d/SnapToGeometryEntry.js"></script>
	<script src="draw2d/SnapToGrid.js"></script>
	<script src="draw2d/ToggleButton.js"></script>
	<script src="draw2d/ToolGeneric.js"></script>
	<script src="draw2d/ToolPalette.js"></script>
	<script src="draw2d/Dialog.js"></script>
	<script src="draw2d/InputDialog.js"></script>
	<script src="draw2d/PropertyDialog.js"></script>
	<script src="draw2d/AnnotationDialog.js"></script>
	<script src="draw2d/PropertyWindow.js"></script>
	<script src="draw2d/ColorDialog.js"></script>
	<script src="draw2d/LineColorDialog.js"></script>
	<script src="draw2d/BackgroundColorDialog.js"></script>
	<script src="draw2d/AnnotationDialog.js"></script>
        
        <!-- undo/redo support (all times required too) -->
	<script src="draw2d/Command.js"></script>
	<script src="draw2d/CommandStack.js"></script>
	<script src="draw2d/CommandStackEvent.js"></script>
	<script src="draw2d/CommandStackEventListener.js"></script>
	<script src="draw2d/CommandAdd.js"></script>
	<script src="draw2d/CommandDelete.js"></script>
	<script src="draw2d/CommandMove.js"></script>
	<script src="draw2d/CommandMoveLine.js"></script>
	<script src="draw2d/CommandResize.js"></script>
	<script src="draw2d/CommandSetText.js"></script>
	<script src="draw2d/CommandSetColor.js"></script>
	<script src="draw2d/CommandSetBackgroundColor.js"></script>
	<script src="draw2d/CommandConnect.js"></script>
	<script src="draw2d/CommandReconnect.js"></script>
	<script src="draw2d/Menu.js"></script>
	<script src="draw2d/MenuItem.js"></script>
        
        <!-- Google Ajax Libraries API -->
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        
    </div>
    <script type="text/javascript">
        google.load("prototype","1");
        
        function fncSayHello(i, j, container) {
            var url = 'http://localhost:8080/Mochihua/MochihuaService';
            // notice the use of a proxy to circumvent the Same Origin Policy.

            new Ajax.Request(url, {
              method: 'post',
              requestHeaders: ['Content-Type','text/xml','SOAPAction', 'http://service.mochihua.udlap.mx/sayHello'],
              postBody:"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>\
                            <soap:Body>\
                                <ns0:sayHello xmlns:ns0='http://service.mochihua.udlap.mx/'>\
                                    <name>"+i+"</name>\
                                    <email>"+j+"</email>\
                                </ns0:sayHello>\
                            </soap:Body>\
                        </soap:Envelope>",
              onSuccess: function(val) {
                var document = val.responseXML;
                var results = document.evaluate("//return",document, null, XPathResult.ANY_TYPE, null);
                container.innerHTML = results.iterateNext().textContent;
                //alert(results.iterateNext().textContent);
              },
              onFailure: function() {
                  alert("Error");
              }
            });

        }
    </script>

  </head>
  <body>
    <input name="i" id="i" />
    <input name="j" id="j" />
    <input value="Add" 
           type="button" 
           onclick="fncSayHello($('i').value,$('j').value,$('result'))" />
    <div id="container">Result:
    <div id="result">
    </div>
    </div>
  </body>
</html>
